import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    Components({
      resolvers: [
        AntDesignVueResolver()
      ]
    })
  ],
  server: {
    proxy: {
      '/wiki': {
        target: 'https://www.dota2.com.cn',
        changeOrigin: true,
        rewrite:(path)=> path.replace(/^\/wiki/,'')
      },
      "/heroimg": {
        "target": "https://img.dota2.com.cn/dota2static/",
        "changeOrigin": true,
        rewrite:(path)=> path.replace(/^\/heroimg/,'')
      }
    }
  },
  css: {
    preprocessorOptions: {
      less: {
        charset:false
      }
    }
  },

})
